﻿using Newtonsoft.Json;
using NPOI.HSSF.Record.Chart;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using WMSpublic;
using static WMSpublic.ParseAPI;

namespace Customer.Read.API.Server
{
    public class httpshow
    {
        /// <summary>
        /// 显示产品信息
        /// </summary>
        /// <param name="productsCode"></param>
        /// <param name="productsName"></param>
        /// <param name="pindex"></param>
        /// <param name="psize"></param>
        /// <returns></returns>
        public async Task<dynamic> GetProductList(string? productsCode, string? productsName,int pindex, int psize)
        {
            string token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyNiIsInNpZCI6IjE4NTk4MDM1MDY2MzA4NTY3MDQiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL2dyb3Vwc2lkIjoiMiIsImp0aSI6IjQzMzA2NmRmLWYyNjAtNDI2Ny1iYWY5LWJkMzgxZGVhZGMwYiIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL25hbWUiOiLku5jmtJvlmIkiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy91cmkiOiIiLCJpc3MiOiJSZW5hb2JvMjAwNCIsImF1ZCI6IldlaWZ1d3UyMjAzQSJ9.JtV8g_mbUcJgyPC793AMsvjLkmkeuiRR9BAH6rQp8aU";
            HttpClientWrapper cilent = new HttpClientWrapper(token);

            string chanpin = "http://116.205.121.197:8000/cpd/api/ProductRead/GetAllProductInfo?productsCode=" + productsCode + "&productsName="+ productsName + "&pageindex=" + pindex + "&pagesize=" + psize;

            string postReponse = await cilent.GetAsync(chanpin);
            return postReponse;
        }


        /// <summary>库位的下拉框产品信息
        /// </summary>
        /// <param name="StoreCode"></param>
        /// <param name="StoreName"></param>
        /// <param name="pageIndex"></param>
        /// <param name="PageSize"></param>
        /// <param name="wid"></param>
        /// <returns></returns>
        public async Task<dynamic> GetStorehouseList(string? StoreCode, string? StoreName, int pageIndex, int PageSize,int? wid)
        {
            string token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyNiIsInNpZCI6IjE4NTk4MDM1MDY2MzA4NTY3MDQiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL2dyb3Vwc2lkIjoiMiIsImp0aSI6IjQzMzA2NmRmLWYyNjAtNDI2Ny1iYWY5LWJkMzgxZGVhZGMwYiIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL25hbWUiOiLku5jmtJvlmIkiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy91cmkiOiIiLCJpc3MiOiJSZW5hb2JvMjAwNCIsImF1ZCI6IldlaWZ1d3UyMjAzQSJ9.JtV8g_mbUcJgyPC793AMsvjLkmkeuiRR9BAH6rQp8aU";
            HttpClientWrapper cilent = new HttpClientWrapper(token);
            string chanpin = "http://116.205.121.197:8000/ckd/api/ReadStorehouse/GetStorehouseList?pageIndex=" + pageIndex + "&PageSize=" + PageSize + "&StoreCode=" + StoreCode + "&StoreName=" + StoreName + "&wid=" + wid;

            string postReponse = await cilent.GetAsync(chanpin);
            return postReponse;
        }
    }
    
    
}
